
-- project
-- version
set_version("2.7.7", {build = "%Y%m%d"})

-- set xmake min version
set_xmakever("2.2.3")

set_languages("c11", "cxx17")

add_rules("mode.debug", "mode.release")

includes("3rd/lua")

target("test")
    set_kind("binary")
    add_files("src/main.cpp", "src/core/*.cpp", "src/fsm/*.cpp", "src/obj/*.cpp")
    add_headerfiles("src/obj/*.h", "src/fsm/*.h", "src/core/*.h")
    add_deps("plainlua")
    add_includedirs("src", "3rd")

    --[[if is_mode("debug") then
        set_optimize("none")
        --add_cxflags("-Od", {force = true})
        --set_optimize("fast")
        add_defines("DEBUG")
        --add_cxxflags("-g", "/Od")
        set_symbols("debug")
    end--]]
    --add_linkdirs("$(buildir)/lib")

    after_build(function(target)
        local targetdir = target:targetdir()
        os.cp("$(projectdir)/res/res/**", targetdir.. "/Resources/", {rootdir = "res"})
        os.cp("$(projectdir)/res/luasrc/**.lua", targetdir.. "/Resources/", {rootdir = "res"})
    end)

-- useage xmake project -k vs -m "debug"